<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Largezhou\WechatMenu\Data;
use Largezhou\WechatMenu\Manager;

class WechatController extends Controller
{
    use \Largezhou\WechatMenu\Controller {
        resources as originResources;
    }

    public function serve()
    {
        return Manager::getInstance()->serve();
    }

    public function resources(Request $request)
    {
        if ($request->isMethod('post') && !config('app.real_save')) {
            return Data::success('演示站，数据没有真正保存');
        }

        return $this->originResources();
    }
}
